<div class="container_12">

     <div class="prefix_10"class="grid_5">
    <div class="grid_12">
        
        
  |Bienvenido..! <?php echo $this->session->userdata('name'); ?>

        
    </div>
   <div class="grid_12">
        
        <?= anchor('users/logout','salir') ?>
    </div> </div>
    <div class="grid_12" >

        <table>
            
       
<tr>   <td>Numero usuario:</td>    <td WIDTH="100"></td>   <td><?= $this->session->userdata('user_id');?></td>       </tr>
<tr>   <td>Nombre Usuario:</td>    <td></td>    <td><?= $this->session->userdata('nombre_usuario');?></td>       </tr>    
<tr>   <td>Email:</td>             <td></td>    <td><?= $this->session->userdata('mail');?></td>                
           
    





 </table>



<table class="formatotable" border="3" WIDTH="600">

       
        <th>  id </th>
          <th>  Categoria </th>
            <th>  Nombre </th>
              <th>  Descripcion </th>
                <th>  Cantidad </th>
                  <th>  Precio </th>
                  <th>  id_user </th>
                  <th>  ------- </th>
    
<?php
$iduser=$this->session->userdata('user_id');
$this->db->where('id_user', $iduser);
 $consulta = $this->db->get('productos');
 
 foreach($consulta->result() as $prod_row)
{
   ?>
    
            <tr>
                
                <td> <?= $prod_row->id_producto;?></td> 
                <td> <?= $prod_row->categoria;?></td> 
                <td> <?= $prod_row->nombre;?></td> 
                <td> <?= $prod_row->descripcion;?></td> 
                <td> <?= $prod_row->cantidad;?></td>
                <td> <?= $prod_row->precio;?></td>
                <td> <?= $prod_row->id_user;?></td>
                <td>
                <?php
                  $unavariable1 = $prod_row->id_producto;
                ?>    
    <a href="borrar_producto?variable=<?php echo $unavariable1; ?>">Borrar</a>
                </td>
             
      </tr> <?php }?>
      
        </table>
<?php /*

foreach($data->result() as $prod_row)
{
echo $prod_row->id_producto;    
echo $prod_row->categoria;    
echo $prod_row->nombre;
echo $prod_row->descripcion;
echo $prod_row->cantidad;
echo $prod_row->precio;
echo $prod_row->id_user;


}



$tmpl = array ( 'table_open' => '<table border="8" cellpadding="2"cellspacing="1" class="mytable">' );

$this->table->set_caption("Lista de productos");
$this->table->set_template($tmpl);
$this->table->set_heading(array(
    'id_pruducto',    
    'categoria',
    'nombre',
    'descripcion',
    'cantidad',
    'precio',
    'id_user'
));
foreach ($consulta->result_array() as $prod_row) {
    $this->table->add_row(array(
       
        $prod_row['id_producto'],
        $prod_row['categoria'],
        $prod_row['nombre'],
        $prod_row['descripcion'],
        $prod_row['cantidad'],
        $prod_row['precio'],
        $prod_row['id_user']
        ));
}


echo $this->table->generate();

  */?></div></div>


